/***********************************************
 This file is part of redia-bapps-main-ios.
 
 Copyright (c) 2015 Redia A/S
 
 Redia-bapps-main-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 Redia-bapps-main-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-bapps-main-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */

//
//  BAHolding.m
//  redia-bapps-ios
//
//  Created by Henrik Lynbech on 01/10/13.
//  Copyright (c) 2013 redia. All rights reserved.
//

#import "BAHolding.h"
#import "JSONEncodingHelperMethods.h"

@implementation BAHolding

+ (id)objectWithJSONObject:(NSDictionary *)jsonObj
{
    BAHolding *obj = [BAHolding new];
    
    obj.locationId = [JSONEncodingHelperMethods parseStringWithKey:@"locationId" fromJsonObject:jsonObj];
    EXPECT_OBJECT(NSString, obj.locationId);
    obj.subLocationId = [JSONEncodingHelperMethods parseStringWithKey:@"subLocationId" fromJsonObject:jsonObj];
    EXPECT_OBJECT(NSString, obj.subLocationId);
    obj.branchId = [JSONEncodingHelperMethods parseStringWithKey:@"branchId" fromJsonObject:jsonObj];
    EXPECT_OBJECT(NSString, obj.branchId);
    obj.collectionId = [JSONEncodingHelperMethods parseStringWithKey:@"collectionId" fromJsonObject:jsonObj];
    EXPECT_OBJECT(NSString, obj.collectionId);
    obj.departmentId = [JSONEncodingHelperMethods parseStringWithKey:@"departmentId" fromJsonObject:jsonObj];
    EXPECT_OBJECT(NSString, obj.departmentId);
    obj.shelfMark = [JSONEncodingHelperMethods parseStringWithKey:@"shelfMark" fromJsonObject:jsonObj];
    EXPECT_OBJECT(NSString, obj.shelfMark);
    
    obj.nofAvailableForLoanCopies = [JSONEncodingHelperMethods parseIntegerWithKey:@"nofAvailableForLoanCopies" fromJsonObject:jsonObj];
    obj.nofCheckedOutCopies = [JSONEncodingHelperMethods parseIntegerWithKey:@"nofCheckedOutCopies" fromJsonObject:jsonObj];
    obj.nofOrderedCopies = [JSONEncodingHelperMethods parseIntegerWithKey:@"nofOrderedCopies" fromJsonObject:jsonObj];
    obj.nofReferenceCopies = [JSONEncodingHelperMethods parseIntegerWithKey:@"nofReferenceCopies" fromJsonObject:jsonObj];
    obj.nofTotalCopies = [JSONEncodingHelperMethods parseIntegerWithKey:@"nofTotalCopies" fromJsonObject:jsonObj];

    return obj;
}

-(NSDictionary *)toJSONObject{
    DLog(@"Not implemented");
    return nil;
}

@end
